<?php

namespace app\adminapi\controller;

use think\Controller;

class Upload extends BaseApi
{
    public function logo(){
            $type = input('type');
            if(empty($type)){
                $this->fail('缺少参数type');
            }
            $file = request()->file('logo');
            if(empty($file)){
                $this->fail('缺少上传文件');
            }
            $info = $file->move('uploads/'.$type);
            if($info){
                $path = $info->getSaveName();
                $this->ok($path);
            }else{
                $this->fail($file->getError());
            }
        
    }
}
